<template>
  <div>
    <van-cell title="历史记录">
      <template>
        <van-icon name="delete" @click="$emit('delAllHistory')" />
      </template>
    </van-cell>
    <van-cell v-for="(item, i) in history" :key="i">
      <template #title>
        <div @click="$emit('searchs', item)">{{ item }}</div>
      </template>
      <template>
        <van-icon name="cross" @click="$emit('delHistory', i)" />
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'SearchHistory',
  props: {
    history: {
      type: Array,
      default: () => []
    }
  }
}
</script>

<style></style>
